package br.com.iswe.gwt.ui.client;

import java.sql.Timestamp;
import java.util.Date;

import br.com.iswe.core.entidades.gwt.RemoteEntityObject;
import br.com.iswe.gwt.crud.client.PropertyNotFoundException;

public class EntityTest extends RemoteEntityObject{

	private Boolean		checkBox;
	private String 		textBox;
	private Integer 	listBox;
	private String 		textArea;
	private String 		passwordTextBox;
	private Date 		dateBox;
	private Timestamp	dateTimeBox;
	private Integer 	radioGroupTeste;
	
	public String getTextBox() {
		return textBox;
	}
	public void setTextBox(String textbox) {
		this.textBox = textbox;
	}
	public Integer getListBox() {
		return listBox;
	}
	public void setListBox(Integer listBox) {
		this.listBox = listBox;
	}
	public String getTextArea() {
		return textArea;
	}
	public void setTextArea(String textArea) {
		this.textArea = textArea;
	}
	public String getPasswordTextBox() {
		return passwordTextBox;
	}
	public void setPasswordTextBox(String passwordTextBox) {
		this.passwordTextBox = passwordTextBox;
	}
	public Date getDateBox() {
		return dateBox;
	}
	public void setDateBox(Date dateBox) {
		this.dateBox = dateBox;
	}
	public Timestamp getDateTimeBox() {
		return dateTimeBox;
	}
	public void setDateTimeBox(Timestamp dateTimeBox) {
		this.dateTimeBox = dateTimeBox;
	}
	public Integer getRadioGroupTeste() {
		return radioGroupTeste;
	}
	public void setRadioGroupTeste(Integer radioGroupTeste) {
		this.radioGroupTeste = radioGroupTeste;
	}
	public Boolean getCheckBox() {
		return checkBox;
	}
	public void setCheckBox(Boolean checkBox) {
		this.checkBox = checkBox;
	}
	
	public void setPropertyValue(String propertyName, Object value) {
		if("checkBox".equals("checkBox")){
			setCheckBox( getBooleanPropertyValue(value) );
		}
		else if("listBox".equals(propertyName)){
			setListBox( getIntegerPropertyValue(value) );
		}
		else if("textBox".equals(propertyName)){
			setTextBox( getStringPropertyValue(value) );
		}
		else if("textArea".equals(propertyName)){
			setTextArea( getStringPropertyValue(value) );
		}
		else if("passwordTextBox".equals(propertyName)){
			setPasswordTextBox( getStringPropertyValue(value) );
		}
		else if("dateBox".equals(propertyName)){
			setDateBox( getDatePropertyValue(value) );
		}
		else if("dateTimeBox".equals(propertyName)){
			setDateTimeBox( getTimestampPropertyValue(value) );
		}
		else if("radioGroupTeste".equals(propertyName)){
			setRadioGroupTeste( getIntegerPropertyValue(value) );
		}
		else{
			throw new PropertyNotFoundException(propertyName);
		}
	}
	
	@Override
	public Object getPropertyValue(String propertyName) {
		if("checkBox".equals(propertyName)){
			return getCheckBox();
		}
		else if("listBox".equals(propertyName)){
			return getListBox();
		}
		else if("textBox".equals(propertyName)){
			return getTextBox();
		}
		else if("textArea".equals(propertyName)){
			return getTextArea();
		}
		else if("passwordTextBox".equals(propertyName)){
			return getPasswordTextBox();
		}
		else if("dateBox".equals(propertyName)){
			return getDateBox();
		}
		else if("dateTimeBox".equals(propertyName)){
			return getDateTimeBox();
		}
		else if("radioGroupTeste".equals(propertyName)){
			return getRadioGroupTeste();
		}
		else{
			throw new PropertyNotFoundException(propertyName);
		}
	}
	
}
